<!DOCTYPE html>
<html lang="en">
<head>
    <title>Admin Login</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
</head>
<body class="apple-style">
    <div class="login-container">
        <div class="login-card">
            <div class="login-header">
                <i class="fas fa-lock"></i>
                <h1>管理员登录</h1>
            </div>

            <form method="POST" class="login-form">
                <input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>

                <div class="form-group">
                    <label for="username">
                        <i class="fas fa-user"></i> 用户名
                    </label>
                    <input type="text" id="username" name="username" required
                           placeholder="请输入用户名">
                </div>

                <div class="form-group">
                    <label for="password">
                        <i class="fas fa-key"></i> 密码
                    </label>
                    <input type="password" id="password" name="password" required
                           placeholder="请输入密码">
                </div>

                {% with messages = get_flashed_messages(with_categories=true) %}
                    {% if messages %}
                        {% for category, message in messages %}
                            <div class="alert alert-{{ category }}">
                                {{ message }}
                            </div>
                        {% endfor %}
                    {% endif %}
                {% endwith %}

                <button type="submit" class="apple-button primary">
                    <i class="fas fa-sign-in-alt"></i> 登录
                </button>
            </form>
        </div>
    </div>
</body>
</html>